package com.ruoyi.business.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.SysUserSupplierMapper;
import com.ruoyi.business.domain.SysUserSupplier;
import com.ruoyi.business.service.ISysUserSupplierService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户和供应商关联Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2025-07-17
 */
@Service
public class SysUserSupplierServiceImpl implements ISysUserSupplierService 
{
    @Autowired
    private SysUserSupplierMapper sysUserSupplierMapper;

    /**
     * 查询用户和供应商关联
     * 
     * @param userId 用户和供应商关联主键
     * @return 用户和供应商关联
     */
    @Override
    public SysUserSupplier selectSysUserSupplierByUserId(Long userId)
    {
        return sysUserSupplierMapper.selectSysUserSupplierByUserId(userId);
    }

    /**
     * 查询用户和供应商关联列表
     * 
     * @param sysUserSupplier 用户和供应商关联
     * @return 用户和供应商关联
     */
    @Override
    public List<SysUserSupplier> selectSysUserSupplierList(SysUserSupplier sysUserSupplier)
    {
        return sysUserSupplierMapper.selectSysUserSupplierList(sysUserSupplier);
    }

    /**
     * 新增用户和供应商关联
     * 
     * @param sysUserSupplier 用户和供应商关联
     * @return 结果
     */
    @Override
    public int insertSysUserSupplier(SysUserSupplier sysUserSupplier)
    {
        return sysUserSupplierMapper.insertSysUserSupplier(sysUserSupplier);
    }

    /**
     * 修改用户和供应商关联
     * 
     * @param sysUserSupplier 用户和供应商关联
     * @return 结果
     */
    @Override
    public int updateSysUserSupplier(SysUserSupplier sysUserSupplier)
    {
        return sysUserSupplierMapper.updateSysUserSupplier(sysUserSupplier);
    }

    /**
     * 批量删除用户和供应商关联
     * 
     * @param userIds 需要删除的用户和供应商关联主键
     * @return 结果
     */
    @Override
    public int deleteSysUserSupplierByUserIds(String userIds)
    {
        return sysUserSupplierMapper.deleteSysUserSupplierByUserIds(Convert.toStrArray(userIds));
    }

    /**
     * 删除用户和供应商关联信息
     * 
     * @param userId 用户和供应商关联主键
     * @return 结果
     */
    @Override
    public int deleteSysUserSupplierByUserId(Long userId)
    {
        return sysUserSupplierMapper.deleteSysUserSupplierByUserId(userId);
    }
}
